package com.gk.panda.apis.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gk.panda.apis.entity.DataVisualization.vo.MonitoringEquipmentVo;
import com.gk.panda.apis.entity.deviceManager.dto.CloudDirectionDto;
import com.gk.panda.apis.entity.deviceManager.dto.DeviceListDto;
import com.gk.panda.apis.entity.deviceManager.dto.SaveOrChangeDeviceDataDto;
import com.gk.panda.apis.entity.deviceManager.vo.DeviceManagerDetailsVo;
import com.gk.panda.apis.entity.deviceManager.vo.DeviceManagerListVo;
import com.gk.panda.apis.entity.icc.dto.CameraDto;
import com.gk.panda.apis.entity.icc.vo.IccDeviceVo;
import com.gk.panda.apis.entity.icc.vo.VideoListVo;
import com.gk.panda.apis.entity.largeScreen.vo.InfraredCameraVo;
import com.gk.panda.apis.entity.largeScreen.vo.VidiconVo;
import com.gk.panda.pojo.DeviceManager;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @ClassName: DeviceManagerService
 * @Description: 设备管理
 * @author: Sir.yang
 * @date: 2022/11/7 18:37
 * @version: 1.0
 **/
public interface DeviceManagerService extends IService<DeviceManager> {

    /**
     * @description: 新增
     * @param: [dto]
     * @return: java.lang.Integer
     * @date: 2022/11/7 18:48
     * @version: 1.0
     **/
    Integer saveDeviceData(SaveOrChangeDeviceDataDto dto) throws UnsupportedEncodingException;

    /**
     * @description: 修改设备信息
     * @param: [dto]
     * @return: java.lang.Integer
     * @date: 2022/11/7 18:48
     * @version: 1.0
     **/
    Integer changeDeviceData(SaveOrChangeDeviceDataDto dto) throws UnsupportedEncodingException;

    /**
     * @description: 根据设备ID获取设备详情
     * @param: [deviceId]
     * @return: com.gk.panda.apis.entity.deviceManager.vo.DeviceManagerDetailsVo
     * @date: 2022/11/7 18:54
     * @version: 1.0
     **/
    DeviceManagerDetailsVo getDeviceDetailsById(Integer devicdId);


    /**
     * @description: 获取设备列表
     * @param: [dto]
     * @return: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.gk.panda.apis.entity.deviceManager.vo.DeviceManagerListVo>
     * @date: 2022/11/7 19:00
     * @version: 1.0
     **/
    Page<DeviceManagerListVo> getDevicePage(DeviceListDto dto);

    /**
     * @description: 删除设备信息
     * @param: [devicdId]
     * @return: java.lang.Integer
     * @date: 2022/11/9 15:04
     * @version: 1.0
     **/
    Integer removeDeviceById(Integer devicdId) throws UnsupportedEncodingException;

    /**
     * @description: 数据可视化统计数据
     * @param: [orgId]
     * @return: com.gk.panda.apis.entity.DataVisualization.vo.MonitoringEquipmentVo
     * @date: 2022/11/11 14:30
     * @version: 1.0
     *
     * @param orgId*/
    MonitoringEquipmentVo getMonitoringEquipmentCount(List<Integer> orgId);

    /**
     * 从icc获取设备列表
     * @return
     */
    List<IccDeviceVo> iccDeviceListQuery();

    /**
     * 在线监控方向控制
     * @param directionDto
     * @return
     */
    int operateDirect(CloudDirectionDto directionDto);

    /**
     * ICC获取野保相机图片视频列表
     * @param cameraDto
     * @return
     */
    List<VideoListVo> cameraList(CameraDto cameraDto);

    /**
     * 保存或更新大华设备
     * @return
     */
    String saveDeviceFromIcc();

    /**
     * 获取大华Icc红外相机设备列表（设备编号、设备地址、所属机构）
     * @return
     */
    List<DeviceManager> getIccDeviceSn();

    /**
     * 更新电量
     * @param device
     */
    void updatePower(DeviceManager device);

    /**
     * icc摄像机设备根据设备编号获取摄像机实时流
     * @param deviceSn
     * @return
     */
    String getVideoLiveStream(String deviceSn);

    /**
     * 大屏根据机构id获取自身及下属机构摄像机信息
     * @param orgId
     * @return
     */
    VidiconVo getVidiconByOrgId(Integer orgId);

    /**
     * 获取四个区域红外相机数据
     * @return
     */
    List<InfraredCameraVo> getInfraredCamera();

    /**
     * 根据设备编号获取设备详情
     * @param deviceSn
     * @return
     */
    DeviceManager getDeviceBySn(String deviceSn);

    /**
     * 根据机构id获取自身及下属机构设备编号列表
     * @param orgId
     * @return
     */
    List<String> getDeviceSnListByOrgId(Integer orgId);

    /**
     * 下载红外相机导入模板
     *
     * @param response P
     */
    void getInfraredTemplate(HttpServletResponse response);

    /**
     * 下载摄像机导入模板
     *
     * @param response P
     */
    void getVideoTemplate(HttpServletResponse response);

    /**
     * 大屏获取实时直播视频地址列表
     * @return
     */
    List<String> getLiveVideo();

    /**
     * 下载生态设备导入模板
     *
     * @param response P
     */
    void getEcologicalTemplate(HttpServletResponse response);

    /**
     * 批量导入红外相机信息
     *
     * @param file P
     * @return R
     */
    String importInfrared(MultipartFile file) throws UnsupportedEncodingException;

    /**
     * 批量导入摄像机信息
     *
     * @param file P
     * @return R
     */
    String importVideo(MultipartFile file) throws UnsupportedEncodingException;

    /**
     * 批量导入生态设备信息
     *
     * @param file P
     * @return R
     */
    String importEcological(MultipartFile file) throws UnsupportedEncodingException;

    /**
     * 批量导出红外相机信息
     *
     * @param response P
     */
    void exportInfrared(HttpServletResponse response);

    /**
     * 批量导出摄像机信息
     *
     * @param response P
     */
    void exportVideo(HttpServletResponse response);

    /**
     * 批量导出生态设备信息
     *
     * @param response P
     */
    void exportEcological(HttpServletResponse response);

    /**
     * 根据当前登录用户获取所属机构及下属机构红外相机列表
     * @return
     */
    List<DeviceManager> infraredCameraListByCurrentUser();

    /**
     * 获取陈博士相机列表
     * @return
     */
    List<DeviceManager> getChenDeviceSn();
}
